import App from './App'

import uView from "uview-ui";
Vue.use(uView);

import utils from './utils/util.js'
import tool from './utils/tool.js'
Vue.prototype.tool = tool
Vue.prototype.util = utils
Vue.prototype.cdn = utils.cdn

// #ifdef APP
Vue.prototype.safeTop = uni.getSystemInfoSync().statusBarHeight + 'px';
// #endif
// #ifdef H5
Vue.prototype.safeTop = 20 + 'px';
// #endif
// #ifdef MP-WEIXIN
// const res = wx.getMenuButtonBoundingClientRect()
// Vue.prototype.safeTop = res.top+res.height + 'px';
// #endif

// 全局导入过滤器
import filter from './utils/filter.js'
Object.keys(filter).forEach(key => Vue.filter(key, filter[key]))

// #ifndef VUE3
import Vue from 'vue'
Vue.config.productionTip = false
App.mpType = 'app'
const app = new Vue({
    ...App
})
app.$mount()
// #endif

// #ifdef VUE3
import { createSSRApp } from 'vue'
export function createApp() {
  const app = createSSRApp(App)
  return {
    app
  }
}
// #endif